package com.ruoyi.ly.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ly.mapper.LyGroupBuyingMapper;
import com.ruoyi.ly.domain.LyGroupBuying;
import com.ruoyi.ly.service.ILyGroupBuyingService;

/**
 * 团购活动Service业务层处理
 * 
 * @author liuyan
 * @date 2025-05-12
 */
@Service
public class LyGroupBuyingServiceImpl implements ILyGroupBuyingService 
{
    @Autowired
    private LyGroupBuyingMapper lyGroupBuyingMapper;

    /**
     * 查询团购活动
     * 
     * @param id 团购活动主键
     * @return 团购活动
     */
    @Override
    public LyGroupBuying selectLyGroupBuyingById(Long id)
    {
        return lyGroupBuyingMapper.selectLyGroupBuyingById(id);
    }

    /**
     * 查询团购活动列表
     * 
     * @param lyGroupBuying 团购活动
     * @return 团购活动
     */
    @Override
    public List<LyGroupBuying> selectLyGroupBuyingList(LyGroupBuying lyGroupBuying)
    {
        return lyGroupBuyingMapper.selectLyGroupBuyingList(lyGroupBuying);
    }

    /**
     * 新增团购活动
     * 
     * @param lyGroupBuying 团购活动
     * @return 结果
     */
    @Override
    public int insertLyGroupBuying(LyGroupBuying lyGroupBuying)
    {
        return lyGroupBuyingMapper.insertLyGroupBuying(lyGroupBuying);
    }

    /**
     * 修改团购活动
     * 
     * @param lyGroupBuying 团购活动
     * @return 结果
     */
    @Override
    public int updateLyGroupBuying(LyGroupBuying lyGroupBuying)
    {
        return lyGroupBuyingMapper.updateLyGroupBuying(lyGroupBuying);
    }

    /**
     * 批量删除团购活动
     * 
     * @param ids 需要删除的团购活动主键
     * @return 结果
     */
    @Override
    public int deleteLyGroupBuyingByIds(Long[] ids)
    {
        return lyGroupBuyingMapper.deleteLyGroupBuyingByIds(ids);
    }

    /**
     * 删除团购活动信息
     * 
     * @param id 团购活动主键
     * @return 结果
     */
    @Override
    public int deleteLyGroupBuyingById(Long id)
    {
        return lyGroupBuyingMapper.deleteLyGroupBuyingById(id);
    }
}
